import React from 'react'
import Todo from '../../components/Todo';

const TodoList = ({todoArray, onTodoClick}) => (
    <ul>
        {todoArray.map((todo, index) => (
            <Todo key={index} {...todo} onClick={() => onTodoClick(index)}/>
        ))}
    </ul>
);

export default TodoList